package cn.com.blueInfo.bpm.template.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 节点类型
 * @author suxch
 * @since 2025/8/28 22:51
 */
@Getter
@AllArgsConstructor
public enum ProcessNodeType implements BaseEnum<String> {

    /** 节点类型-起草节点 */
    DRAFT("DRAFT", "起草节点"),
    /** 节点类型-审批节点 */
    APPROVE("APPROVE", "审批节点"),
    /** 节点类型-抄送节点 */
    CC("CC", "抄送节点"),
    /** 节点类型-结束节点 */
    END("END", "结束节点");

    @EnumValue
    private final String code;

    @JsonValue
    private final String desc;

    public static ProcessNodeType getByCode(String code) {
        return BaseEnum.getByCode(ProcessNodeType.class, code);
    }

    @JsonCreator
    public static ProcessNodeType getByName(String name) {
        return BaseEnum.getByName(name, ProcessNodeType.class);
    }

}
